package cn.iocoder.yudao.module.trade.api.config;

import cn.iocoder.yudao.module.trade.api.config.dto.AddressRespDTO;
import cn.iocoder.yudao.module.trade.api.config.dto.TradeConfigRespDTO;
import cn.iocoder.yudao.module.trade.convert.config.TradeConfigConvert;
import cn.iocoder.yudao.module.trade.service.config.TradeConfigService;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;

@Service
@Validated
public class TradeConfigApiImpl implements TradeConfigApi {

    @Resource
    private TradeConfigService tradeConfigService;

    @Override
    public TradeConfigRespDTO getTradeConfig() {
        return TradeConfigConvert.INSTANCE.convert2(tradeConfigService.getTradeConfig());
    }

    @Override
    public boolean checkMessage(String content, String userId) {
        return tradeConfigService.checkMessage(content, userId);
    }

    @Override
    public boolean checkImg(String img, String userId) {
        return tradeConfigService.checkImg(img, userId);
    }

    @Override
    public boolean checkQrcode(String img) {
        return tradeConfigService.checkQrcode(img);
    }

    @Override
    public boolean checkImgQrcode(String img) {
        return tradeConfigService.checkImgQrcode(img);
    }

    @Override
    public boolean checkHasQrcode(String img) {
        return tradeConfigService.checkHasQrcode(img);
    }

    @Override
    public boolean checkVoice(String voice, String userId) {
        return tradeConfigService.checkVoice(voice, userId);
    }

    @Override
    public AddressRespDTO getAddressByIp(String ip) {
        return tradeConfigService.getAddressByIp(ip);
    }
}
